<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" session="false" %><%@
include file="/WEB-INF/jspf/import.jspf" %>

<!doctype HTML>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
        <title>${club.name}_中国车友会_中国最大、最好的车友会平台</title>
        <meta name="keywords" content="${fn:escapeXml(club.name)}" />
        <meta name="description" content="${fn:escapeXml(club.introduce)}" />
        <meta name="author" content="lianglixing_gz none" />
        <link rel="stylesheet" type="text/css" href="http://js.3conline.com/wap/pcauto/2014/cheyouhui/css/cyh.css">
        <style type="text/css">
            p.des a,p.des a:active,p.des a:visited{
                color:#2a8de9;
            }
        </style>
    </head>

    <body>
        <!--栏目计数器/文章计数器-->
        <jsp:include page="/template/wap/common/counter.jspf">
            <jsp:param name="channel" value="7385" />
        </jsp:include>
        <div class="g-doc" id="J-main"> 
            <!-- 公共头部 --> 
           <%@include file="../common/intf6007.html" %>
            <!-- 公共头部end -->

            <div class="header-bg">
                <a href="http://m.pcauto.com.cn" class="header-home" title="太平洋汽车网"></a>
                <div class="header-title">
                    <span class="header-title-nav">
                        <a href="${WAPROOT}/">车友会</a> &gt;  
                        <c:if test="${fn:length(club.name) >= 8}">
                            ${fn:escapeXml(fn:substring(club.name, 0, 8))}...
                        </c:if>
                        <c:if test="${fn:length(club.name) < 8}">
                            ${fn:escapeXml(club.name)}
                        </c:if>
                    </span>
                </div>
                <c:if test="${user!=null && user.uid>0 && isMember}"><a href="${WAPROOT}/${myUrl}/postDyna/" class="g-hd-btn" id="Jadd"></a></c:if>
                <c:if test="${user==null || user.uid==0}"><a href="${UCWAPROOT}/passport/login.jsp?return=${WAPROOT}/${myUrl}/" class="g-hd-btn" id="Jadd"></a></c:if>
            </div>

            <div class="wapper">
                <div class="m-cyhinfo">
                    <div class="topBg">
                        <img src="http://www1.pcauto.com.cn/autoclub/wap/20140902/images/infoBg.jpg" />
                    </div>
                    <div class="infoTxt">
                        <div class="picL">
                            <a href="${WAPROOT}/${myUrl}/info/">
                                <span class="cyhLogo">
                                    <img src="${club.logo}" alt="">
                                </span>
                            </a>
                            <c:if test="${user!=null && user.uid>0 && !isMember && !isApply}"><a href="javascript:joinIn();" class="qiandao" id="Jsignbtn">申请加入</a></c:if>
                            <c:if test="${user!=null && user.uid>0 && isMember}"><a href="javascript:sign();" class="qiandao" id="Jsignbtn">签到</a></c:if>
                            <c:if test="${user==null || user.uid==0}"><a href="javascript:joinIn();" class="qiandao" id="Jsignbtn" style="background-color: rgb(174, 174, 174);">签到</a></c:if>
                            <c:if test="${isApply}"><i  class="qiandao check"  >审核中</i></c:if>
                        </div>
                        <div class="info-text">
                            <c:if test="${fn:length(club.name) >= 8}">
                                <p class="name"> ${fn:substring(club.name, 0, 8)}...</p>
                            </c:if>
                            <c:if test="${fn:length(club.name) < 8}">
                                <p class="name"> ${club.name}</p>
                            </c:if>
                            <p class="star">
                                <em style="width:${club.levelId*20}%;"></em>
                            </p>
                            <p class="rank">
                                <c:if test="${club.rank>0 && club.levelId>0}">
                                    <span class="r1">全国排名：<em>${club.rank}</em></span>
                                </c:if>
                                <c:if test="${club.brandId>0 && club.brandRank>0}">
                                    <span class="r2">${empty club.brandName?"品牌":club.brandName}排名：<em>${club.brandRank}</em></span>
                                </c:if>
                            </p>
                            <p class="oil">油值：<em>${club.totalPetrol}L</em></p>
                        </div>
                    </div>

                </div>
                <div class="nav">
                    <a href="${WAPROOT}/${myUrl}/member/">
                        <i>${club.memberNum}</i><i>成员</i>
                    </a>
                    <a href="${WAPROOT}/${myUrl}/album/">
                        <i>${photoSum}</i><i>相册</i>
                    </a>
                    <a href="${WAPROOT}/${myUrl}/topic/">
                        <i>${topicSum}</i><i>车友帖</i>
                    </a>
                    <a href="${WAPROOT}/${myUrl}/activity/">
                        <i>${activitySum}</i><i>活动</i>
                    </a>
                </div>
                <div class="section">
                    <ul class="list" id="JdataList">

                    </ul>
                    <p class="loading" id="Jloading">点击查看更多</p>
                </div>
            </div>  

            <!--隐藏评论输入框-->
            <div class="comment" id="comment_pop"> 
                <!-- 评论输入 -->
                <div class="c-input">
                    <div class="c-top">
                        <div class="c-face"><span class="c-face-btn"></span><span class="c-face-list"></span></div>
                    </div>
                    <div class="c-area">
                        <textarea id="content_pop" placeholder="评论"></textarea>
                    </div>      
                    <div class="c-btn"><span class="c-submit" id="cmtSubmit_pop" onclick="replyDyna(this);">发表</span></div>
                </div>
            </div>
            <!-- 提示层 -->
            <div class="m-tips" id="Jtips"></div>
            <script type="text/javascript" src="http://js.3conline.com/wap/2013/common/js/zepto1.1.min.js" ></script>
            <script src="http://js.3conline.com/wap/common/swipe.extend-min.js"></script>
            <script>
                // 点击查看大图
                $(document).delegate('.picsBox img', 'click', function(e) {
                    var picArray=[], index, col=$(this).closest('.picsBox').find('img');
                    col.each(function() {
                        picArray.push($(this).attr('data-meta'));
                    });
                    index=col.index(this);
                    makeSwipe(picArray, index);
                });


                function makeSwipe(ary,idx){
                    var HTML='',div, fullPicSlider, sliderEle,
                    _windowHeight = document.documentElement.clientHeight,
                    _scrollTop = document.body.scrollTop;

                    idx=idx||0;
                    ary.forEach(function(item,idx){
                        HTML+='<div><img src2="{url}"></div>'.replace('{url}',item);
                    });
                    HTML='<div id="fullPicSlider"><div class="picwrap">'+HTML+'</div><div id="slidenum">123/123</div></div>';
                    div=document.createElement('div');
                    document.body.appendChild(div);
                    div.outerHTML=HTML;
                    sliderEle=document.getElementById('fullPicSlider');
                    sliderEle.addEventListener("touchmove", function(e){
                        if (e.touches.length>1){
                            e.preventDefault();
                        }
                    }, false);
                    fullPicSlider = swipe(sliderEle,{
                        startSlide:idx,
                        callback :render,
                        disableScroll :true
                    });
                    sliderEle.style.top=_scrollTop+'px';
                    sliderEle.onclick=delSwipe;

                    window.addEventListener('orientationchange',function(){
                        sliderEle.style.top=document.body.scrollTop+'px';
                    },false);

                    window.addEventListener('scroll',function(){
                        sliderEle.style.top=document.body.scrollTop+'px';
                    },false);
                    
                    function render(index, elem){
                        var total=ary.length;
                        document.getElementById('slidenum').innerHTML=(index*1+1)+'/'+total;

                        //elem.parentNode.style.height = (elem.clientHeight||elem.offsetHeight) + "px";
                    }

                    function delSwipe(){
                        var dom=document.getElementById('fullPicSlider');
                        fullPicSlider.kill();
                        dom.parentNode.removeChild(dom);
                    }

                }
            </script>
            <script>
                //事件绑定
                function touchEvent(elm,fn) {
                    if ("ontouchstart" in document.documentElement) {
                        elm.addEventListener("touchstart",fn,false);
                    }else {
                        elm.addEventListener("click",fn,false);
                    }
                }

                /*各种提示*/
                function showTips(msg){
                    var tips = document.getElementById('Jtips');
                    if(!tips) {
                        tips = document.createElement('div');
                        tips.id = 'Jtips';
                        tips.className = 'm-tips';
                        document.body.appendChild(tips);
                    }
                    tips.innerHTML = msg;
                    tips.style.display = 'block';
                    var tips_width = tips.clientWidth/2;
                    tips.style.marginLeft = '-'+tips_width+'px';
                    tips.style.opacity = 1;    
                    setTimeout(function(){
                        tips.style.webkitTransition = 'all 0.3s ease-in';
                        tips.style.opacity = 0;
                        tips.style.marginTop = '-80px';
                        setTimeout(function(){
                            tips.style.display = 'none';
                            tips.style.marginTop = '-40px';
                        }, 300);
                    }, 2000);
                }


                var isLogin = ${user!=null && user.uid!=0},isMember = ${isMember};
                var isSend = 0;
                // 加入登录跳转
                function joinIn(){
                    if ('${empty user or user.uid == 0}' == 'true') {
                        location.href = "${UCWAPROOT}/passport/login.jsp?return=${WAPROOT}/${myUrl}/";
                    } else {
                        if( isSend == 1 ){
                            return;
                        }
                        isSend = 1;
                        $.ajax({
                            type: 'POST',
                            async: false,
                            url: "${ROOT}/wap/club/toApply.do?req_enc=utf-8&resp_enc=utf-8&clubId=${club.clubId+0}&_t=" + new Date().getTime(),
                            dataType: 'jsonp',
                            jsonpCallback:'aFunc3',
                            success: function(data) {
                                if (data.statusCode == 0) {
                                    location.href = data.url;
                                } else if (data.statusCode == 1) {
                                    showTips(data.message);
                                }
                                isSend = 0 ;
                            }
                        });
                    }
                }
                // 签到
                function sign(){
                    if ('${empty user or user.uid == 0}' == 'true') {
                        $('#Jsignbtn').text("加入").attr('href', 'javascript:joinIn();');
                        return;
                    }
                    $.ajax({
                        type: 'POST',
                        url: "${WAPROOT}/checkIn.do?req_enc=utf-8&resp_enc=utf-8&clubId=${club.clubId+0}&agent=1&_t=" + new Date().getTime(),
                        dataType: 'json',
                        success: function(data) {
                            if (!!data && data.status == 0) {
                                var checkIn = new Function("return ("+data.desc+");")();
                                showTips('<b>已签到</b>累计签到：'+(checkIn.totalCheckIns)+'天<br/>连续签到：'+(checkIn.continuousCheckIns)+'天', '100px');
                                $('#Jsignbtn').text("已签到").css('backgroundColor', '#aeaeae').attr('href', 'javascript:void(0);');
                            } else {
                                showTips(data.desc);
                            }
                        }
                    });
                }
                function loadCheckInStat(){
                    $.ajax({
                        type: 'POST',
                        async: false,
                        url: "${ROOT}/checkIn/stat.do?req_enc=utf-8&resp_enc=utf-8&clubId=${club.clubId+0}&_t=" + new Date().getTime(),
                        dataType: 'jsonp',
                        jsonpCallback:'aFunc',
                        success: function(data) {
                            if(!!data && data.status == 0){
                                var checkIn = new Function("return ("+data.desc+");")();
                                if (checkIn.hasCheckedInToday) {
                                    $('#Jsignbtn').text("已签到").css('backgroundColor', '#aeaeae').attr('href', 'javascript:void(0);');
                                } else {
                                    $('#Jsignbtn').text("签到").attr('href', 'javascript:sign();');
                                    $('#Jtips').html('<b>已签到</b>累计签到：'+(checkIn.total+1)+'天<br/>连续签到：'+(checkIn.continuous+1)+'天');
                                }
                            }
                        }
                    });
                }
                //发表或签到
                function check(){
                    var joinBtn = document.getElementById("Jadd"),
                    signBtn = document.getElementById("Jsignbtn");
                    if(isLogin && !isMember){//登录且非该车友会会员
                        if(joinBtn!=null && signBtn!=null){
                            joinBtn.style.display = "none";
                            signBtn.innerHTML = "申请加入"; 
                        }
                    }
                }
                check();

                //滚动加载
                var count = 1,
                requestOff = false,
                loading = $("#Jloading"),
                container = $('#JdataList')
                isLoading = 0;
                
                function loader() {
                    if(isLoading==1){
                        return;
                    }
                    if (!requestOff) {
                        var url = "${ROOT}/wap/dyna/pageDynaList.do?clubId=${clubId}&isTranceFace=1&callback=?&pageNo=" + count;
                        requestOff = true;
                        // 显示正在加载模块
                        loading.show("slow");
                        // Ajax 翻页
                        $.ajax({
                            url: url,
                            type: "GET",
                            dataType: "json",
                            success: function(data) {
                                var list = data.list,
                                len = list.length;
                                if (len <= 0) {
                                    loading.show().html("亲>_<暂时没有数据哦~");
                                    return;
                                }
                                var html = "",
                                pageCount = data.pageCount;
                                for (var i = 0; i < len; i++) {
                                    var curData = list[i],
                                    tie = curData.isTie == true ? '<em class="tie">帖</em>' : '',
                                    jing = curData.isJing == true ? '<em class="jing">精</em>' : '',
                                    jian = curData.isJian == true ? '<em class="jian">荐</em>' : '',
                                    tipicIcon = '',
                                    picList = curData.piclist,
                                    picsLen = picList.length,
                                    picsHtml = "",
                                    cmtNum = curData.count,
                                    cmt = "";
                                    if(cmtNum > 0){
                                        cmt = '<a href="'+curData.desUrl+'" class="repost" >'+cmtNum+'</a>';
                                    }else{
                                        cmt = '<a href="javascript:void(0);" class="repost" >'+cmtNum+'</a>';
                                    }
                                    if(jian!=''){
                                        tipicIcon = jian;
                                    }else if(jing!=''){
                                        tipicIcon = jing;
                                    }else if(tie!=''){
                                        tipicIcon = tie;
                                    }
                                    //九宫格图
                                    if(picsLen > 0 && picsLen <= 9){
                                        if(picsLen != 4){
                                            picsHtml = '<ul class="pics_9">';
                                            for(var j = 0; j < picsLen; j++){
                                                if(picList[j].smaPic!='' && picList[j].smaPic.length>0){
                                                    picsHtml += '<li>'
                                                        +'<img width='+picList[j].width+' height='+picList[j].height+' src="'+picList[j].smaPic+'" data-meta="'+picList[j].bigPic+'"/>'
                                                        +'</li>';
                                                }    
                                            }
                                            
                                            picsHtml += '</ul>';
                                        }
                                        if(picsLen == 4){
                                            picsHtml = '<ul class="pics_4"><li>';
                                            for(var j = 0; j < picsLen; j++){
                                                if(picList[j].smaPic!='' && picList[j].smaPic.length>0){
                                                    picsHtml += '<img width='+picList[j].width+' height='+picList[j].height+' src="'+picList[j].smaPic+'" data-meta="'+picList[j].bigPic+'"/>';
                                                    if(j % 2 == 1){
                                                        picsHtml +='</li><li>';
                                                    }                      
                                                }
                                            }
                                            picsHtml += '</ul>';
                                        }
                                        if(picsLen == 1){
                                            picsHtml = '<ul class="pics_1">';
                                            for(var j = 0; j < picsLen; j++){
                                                if(picList[j].smaPic!='' && picList[j].smaPic.length>0){
                                                    picsHtml += '<li>'
                                                        +'<img  width='+picList[j].width+' height='+picList[j].height+' src="'+picList[j].smaPic+'" data-meta="'+picList[j].bigPic+'"/>'
                                                        +'</li>';
                                                }
                                            }
                                            picsHtml += '</ul>';
                                        }
                                    }

                                    //数据列表
                                    html += '<li class="item">'
                                        +'<a href="'+curData.myIconUrl+'" class="myIcon">'
                                        +'<img src="'+curData.myIcon+'">'
                                        +'</a>'
                                        +'<input type="hidden" name="dynaInfoId" value="'+curData.dynaInfoId+'"/>' 
                                        +'<input type="hidden" name="replyId" value="0"/>'
                                        +'<input type="hidden" name="createDate" value="'+curData.createDate+'"/>'
                                    ;
                                    if(curData.isTie){
                                        html+='<input type="hidden" name="type" value="1"/><input type="hidden" name="tid" value="'
                                            +curData.topicId+'"/><input type="hidden" name="fid" value="'+curData.fid+'"/>';
                                    }else{
                                        html+='<input type="hidden" name="type" value="2"/>'
                                    }
                                    html+='<div class="item-con">'
                                        +'<p class="name" style="color:#777">'+curData.nickName+'</p>'
                                        +'<p class="tag">'
                                        + tipicIcon
                                        +'</p>'
                                        +'<p class="des">'
                                        + (curData.isTie? '<a class="m-list-tit" href="'+curData.desUrl+'">'+curData.des+'</a>':curData.des)
                                        +'</p>'
                                        +'<div class="picsBox">'
                                        + picsHtml
                                        +'</div>'
                                        +'<div class="ly">'
                                        +'<i class="date">'+curData.time+'</i>'
                                        + cmt
                                        +'</div>'
                                        +'</div>'
                                        +'</li>';
                                }
                                container.append(html)
                                loading.html("点击查看更多");
                                if (count >= pageCount) {
                                    requestOff = true;
                                    if(count > 1){
                                        loading.show().html("亲>_<暂时就这么多了哦~");	
                                    }else{
                                        loading.hide();
                                    }
                                    loading.unbind("click");
                                } else {
                                    requestOff = false;
                                }
                                count++;
                            }
                        });
                    }
                }
                loader();
                loadCheckInStat(); // 签到或加入
                loading.bind("click", function() {    
                    loader();
                });

            </script>
            <script type="text/javascript">
                var faceStr = '<img title="[抠鼻]" src="http://bbs.pcauto.com.cn/images/emot/em2001.gif" /><img title="[鼓掌]" src="http://www1.pcauto.com.cn/autobbs/2013/images/emot/em2002.gif" /><img title="[晕]" src="http://bbs.pcauto.com.cn/images/emot/em2005.gif" /><img title="[微笑]" src="http://bbs.pcauto.com.cn/images/emot/em2007.gif" /><img title="[流泪]" src="http://bbs.pcauto.com.cn/images/emot/em2008.gif" /><img title="[闭嘴]" src="http://bbs.pcauto.com.cn/images/emot/em2011.gif" /><img title="[鄙视]" src="http://bbs.pcauto.com.cn/images/emot/em2012.gif" /><img title="[吐]" src="http://bbs.pcauto.com.cn/images/emot/em2016.gif" /><img title="[奋斗]" src="http://bbs.pcauto.com.cn/images/emot/em2040.gif" /><img title="[疑问]" src="http://bbs.pcauto.com.cn/images/emot/em2044.gif" /><img title="[强]" src="http://bbs.pcauto.com.cn/images/emot/em2046.gif" />';
                var facelist = [
                    ['em2001','[抠鼻]'],
                    ['em2002','[鼓掌]'],
                    ['em2005','[晕]'],
                    ['em2007','[微笑]'],
                    ['em2008','[流泪]'],
                    ['em2011','[闭嘴]'],
                    ['em2012','[鄙视]'],
                    ['em2016','[吐]'],
                    ['em2040','[奋斗]'],
                    ['em2044','[疑问]'],
                    ['em2046','[强]']
                ];
                /*留言*/
                (function(){    
                    // 移动/切换显示回复框
                    function showPopForm(btn) {
                        var wrap = closest(btn, '.item');
                        if(!wrap) return;
                        var cmt = document.getElementById('comment_pop');
                        if(cmt.parentNode == wrap) {
                            // if already here, just toggle it
                            if(btn.innerHTML == '0' && cmt.style.display == "none") {
                                cmt.style.display = 'block';
                            } else if(btn.innerHTML == '0' && cmt.style.display == "block") {
                                cmt.style.display = 'none';
                            }                
                        } else {
                            // 转移评论框           
                            wrap.appendChild(cmt);
                            document.getElementById('content_pop').value = "";
                            cmt.className = "comment"; 
                            cmt.style.display = 'block';
                        }
                    }    
                    // selector 只能用简单的选择器，#id, tagName, .className，单个无组合
                    function closest(ele, selector) {
                        var result,
                        tmp = ele.parentNode;
                        while (tmp) {
                            if (matchSelector(tmp, selector)) {
                                result = tmp;
                                break;
                            }
                            tmp = tmp.parentNode;
                        }
                        return result;
                    }
                    function matchSelector(ele, selector) {
                        // if use id
                        if (selector.charAt(0) === '#') {
                            return ele.id === selector.slice(1);
                        }
                        // if use class
                        if (selector.charAt(0) === '.') {
                            return (' ' + ele.className + ' ').indexOf(' ' + selector.slice(1) + ' ') != -1;
                        }
                        // if use tagName
                        return ele.tagName.toLowerCase() === selector.toLowerCase();
                    }
                    // ============ 简单的事件委托
                    function delegateEvent(interfaceEle, selector, type, fn) {
                        interfaceEle.addEventListener(type, function(e) {
                            if (matchSelector(e.target, selector)) {
                                if(fn) {
                                    fn.call(e.target, e);
                                }
                            }
                        });
                    }
                    // 事件绑定
                    var mainEle = document.getElementById('J-main');
                    // 切换显示表情
                    function toggleFace(faceBtn) {
                        var cmt = closest(faceBtn, '.comment');
                        if(cmt) {
                            cmt.className = cmt.className == 'comment face-open' ? 'comment' : 'comment face-open';
                        }
                    }
                    // 触发切换显示表情
                    var faceBtns = document.querySelectorAll('.comment .c-face-btn');
                    for(var i=faceBtns.length - 1; i >= 0; i--) {
                        (function(n){
                            var item = faceBtns[n];
                            item.addEventListener('click', function(e){
                                var parentNode = item.parentNode,
                                listObj = parentNode.querySelector(".c-face-list");
                                if(listObj.children.length==0){
                                    listObj.innerHTML = faceStr;
                                }
                                toggleFace(item, '.comment');
                            });
                        })(i);          
                    }

                    // 点击表情, append title(ubb code)
                    var faceList = Array.prototype.slice.call(document.querySelectorAll('.comment .c-face-list'));
                    faceList.forEach(function(item){
                        var imgs = item.getElementsByTagName('img');
                    
                        delegateEvent(item, 'img', 'click', function(){
                            // show clicking which face
                            var that = this;
                            that.className = 'hlight';
                            setTimeout(function(){
                                that.className = '';
                            }, 300);
            
                            var cmt = closest(this, '.comment');
                            if(cmt) {
                                var textArea = cmt.querySelector('textarea');
                                if(textArea) {
                                    textArea.value += this.title;
                                }
                            }
                        });
                    });
            
                    // 点击回复评论按钮  
                    delegateEvent(mainEle, '.repost', 'click', function(e){
                        var cmtNum = this.innerHTML;
                        if(cmtNum == 0){
                            var url = window.location.href,
                            cmtNum = this.innerHTML;
                            if(!isLogin){//未登录
                                location.href = "${UCWAPROOT}/passport/login.jsp?return="+url;
                            }else{//登录
                                showPopForm(this);             
                            }    
                        }  
                    });
    

                })()
                function tranFaceToBBS(str){
                    for(var i=facelist.length-1; i>=0; i--) {
                        p = new RegExp(facelist[i][1].replace('[', '\\[').replace(']', '\\]'), 'gm');
                        str = str.replace(p, '\['+facelist[i][0]+'\]');
                    }
                    return str;
                }
                function replyDyna(e){
                    var parent = $(e).parents(".item");
                    var dynaInfoId = parent.find("input[name='dynaInfoId']").val();
                    var replyId = parent.find("input[name='replyId']").val();
                    var content = $("#content_pop").val();
                    if(content=="" || content.length==0){
                        showTips("回复内容不能为空");
                        return;
                    }
                    var type = parent.find("input[name='type']").val();
                    if(type==2){
                        var createDate = parent.find("input[name='createDate']").val();
                        postReplyDyna(e,dynaInfoId,replyId,tranFaceToBBS(content),createDate);
                    }else if(type==1){
                        var tid = parent.find("input[name='tid']").val();
                        var fid = parent.find("input[name='fid']").val();
                        postReplyTopic(e,tid,fid,tranFaceToBBS(content));
                    }
                }
                var postStatus = 0;//是否正在提交中
                //回复动态
                function postReplyDyna(e,dynaInfoId,replyId,content,createDate){
                    if(postStatus==1){
                        return;
                    }
                    postStatus = 1;
                    $.ajax({
                        url:"${WAPROOT}/dyna/replyDyna.do",
                        data:{
                            clubId:${clubId},
                            dynaInfoId:dynaInfoId,
                            postToDynaReplyId:replyId,
                            content:content,
                            createDate:createDate
                        },
                        dataType:"json",
                        type:"post",
                        success:function(data){
                            postStatus = 0;
                            if(data.code==0){
                                $("#comment").removeClass("face-open");
                                $("#comment_pop").hide();
                                showTips("发表成功");
                                $("#content_pop").val("");
                                addReplyNum(e,2,data.data.dynaInfoId);
                            }else{
                                showTips(data.message);
                            }
                        },
                        error:function(xmlHttpRequest, textStatus, errorThrown){
                            postStatus = 0;
                            var message = "网络错误,请联系管理员";
                            if(xmlHttpRequest.status==503){
                                var json = eval("("+xmlHttpRequest.responseText+")");
                                message = (json.message == ""?"网络错误,请联系管理员":json.message);
                            }
                            showTips(message);
                        }
                    });
                }
                function addReplyNum(e,type,id){
                    $(e).parents(".item").find(".repost").html(1);
                    if(type==2){
                        $(e).parents(".item").find(".repost").attr("href","${WAPROOT}/${myUrl}/dt/"+id+"/");
                    }else{
                        $(e).parents(".item").find(".repost").attr("href","${BBSWAPROOT}/topic-"+id+".html");
                    }
                }
                function postReplyTopic(e,tid,fid,content){
                    if(postStatus==1){
                        return;
                    }
                    postStatus = 1;
                    $.ajax({
                        url:"/bbs/action/post/create.ajax",
                        data:{
                            tid:tid,
                            message:content,
                            fid:fid,
                            sendMsg:true
                        },
                        type:"post",
                        success:function(data){
                            postStatus = 0;
                            data = eval("("+data+")");
                            if(data.status==0){
                                $("#comment").removeClass("face-open");
                                $("#comment_pop").hide();
                                showTips("发表成功");
                                $("#content_pop").val("");
                                addReplyNum(e,1,data.tid);
                            
                            }else{
                                showTips(data.desc);
                            }
                        },
                        error:function(xmlHttpRequest, textStatus, errorThrown){
                            postStatus = 0;
                            var message = "网络错误,请联系管理员";
                            if(xmlHttpRequest.status==503){
                                var json = eval("("+xmlHttpRequest.responseText+")");
                                message = (json.message == ""?"网络错误,请联系管理员":json.message);
                            }
                            showTips(message);
                        }
                    });
                }
            </script>
            <!-- 公共底部 --> 
            <%@include file="../common/intf5987.html" %>
            <!-- 公共底部end --> 
        </div>
    </body>
</html>